<template>
  <Card title="待办2" v-bind="$attrs">
    <template v-for="item in navItems" :key="item">
      <CardGrid>
        <span class="flex flex-col items-center relative">
          <Icon :icon="item.icon" :color="item.color" size="20" />
          <!-- 动态绑定待办数量 -->
          <span v-if="item.count > 0" class="absolute top-0 right-0 bg-red-500 text-white text-xs px-1.5 py-0.5 rounded-full">
            {{item.count}}
          </span>
          <span class="text-md mt-2">{{ item.title }}</span>
        </span>
      </CardGrid>
    </template>
  </Card>
</template>

<script lang="ts" setup>
import { Card } from 'ant-design-vue';
import { navItems } from './data';
import { Icon } from '/@/components/Icon';

const CardGrid = Card.Grid;
</script>
